<template>
  <div class="main-container" ref="container">
    <!-- 当路由是 /main 时显示主页内容，其他路由显示子路由内容 -->
    <div v-if="$route.path === '/main'" class="content-card">
      <div class="header-section">
        <div class="header">
          <a
            class="back-link"
            href="http://116.205.137.229/"
            ><i class="el-icon-arrow-left"></i>返回</a
          >
        </div>
        <h1 class="system-title">
          <span class="title-text">人事行政管理系统</span>
        </h1>
        <p class="subtitle">欢迎使用艾美思普科技管理系统</p>
      </div>

      <div class="navigation-section">
        <div class="nav-cards">
          <a class="nav-card" href="http://116.205.137.229:8025/">
            <!--<a class="nav-card" href="http://192.168.110.22:8084/">-->
            <i class="el-icon-office-building"></i>
            <span class="card-title">行政部</span>
            <span class="card-desc">行政事务管理</span>
          </a>
          <router-link class="nav-card" to="/main/renshi">
            <i class="el-icon-user"></i>
            <span class="card-title">人事部</span>
            <span class="card-desc">人事资源管理</span>
          </router-link>
          <router-link class="nav-card" :to="{ name: 'ProcessHome' }">
            <i class="el-icon-share"></i>
            <span class="card-title">流程管理</span>
            <span class="card-desc">审批流程管理</span>
          </router-link>
        </div>
      </div>

      <div class="footer-section">
        <p class="copyright">AIMSP 深圳市艾美思普科技有限公司</p>
      </div>
    </div>
    <!-- 子路由内容 -->
    <router-view v-else></router-view>
  </div>
</template>

<!-- <script setup>
// 由于这是一个简单的展示组件，不需要任何响应式数据和方法
// 如果将来需要添加功能，可以在这里使用 ref, reactive 等组合式API
</script> -->

<style lang="scss" scoped>
.main-container {
  min-height: 100vh;
  // background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
  background: antiquewhite;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.content-card {
  width: 800px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 20px 50px 50px 50px;
  transition: transform 0.3s ease;

  &:hover {
    transform: translateY(-5px);
  }
}

.header-section {
  text-align: center;
  margin-bottom: 45px;

  .system-title {
    // margin-bottom: 16px;

    .title-text {
      display: inline-block;
      background-color: #409eff;
      color: white;
      padding: 12px 30px;
      border-radius: 8px;
      font-size: 20px;
      font-weight: 500;
      box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
    }
  }

  .subtitle {
    color: #909399;
    font-size: 18px;
    margin: 0;
  }
}
.header {
  margin-bottom: 15px;
  text-align: left;
  // position: fixed;
}

.back-link {
  display: inline-flex;
  align-items: left;
  color: #409eff;
  text-decoration: none;
  font-size: 18px;
  align-items: center;
  transition: all 0.3s;
  outline: none;

  i {
    margin-right: 5px;
  }

  &:hover {
    color: #66b1ff;
    transform: translateX(-3px);
  }
}
.navigation-section {
  margin: 40px 0;

  .nav-cards {
    display: flex;
    justify-content: center;
    gap: 40px;
  }

  .nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    width: 200px;
    background-color: #c4dcff;
    border-radius: 12px;
    text-decoration: none;
    color: #303133;
    transition: all 0.3s ease;
    border: 2px solid transparent;

    i {
      font-size: 32px;
      color: #409eff;
      margin-bottom: 16px;
    }

    .card-title {
      font-size: 18px;
      font-weight: 500;
      margin-bottom: 8px;
    }

    .card-desc {
      font-size: 14px;
      color: #909399;
    }

    &:hover {
      background-color: #ecf5ff;
      border-color: #409eff;
      transform: translateY(-5px);
      box-shadow: 0 8px 16px rgba(64, 158, 255, 0.1);

      i {
        transform: scale(1.1);
      }
    }
  }
}

.footer-section {
  text-align: center;
  margin-top: 40px;
  padding-top: 10px;
  border-top: 1px solid #ebeef5;

  .copyright {
    color: #909399;
    font-size: 14px;
    margin: 0;
  }
}

@media screen and (max-width: 768px) {
  .content-card {
    width: 100%;
    padding: 20px;
  }

  .navigation-section {
    .nav-cards {
      flex-direction: column;
      align-items: center;
      gap: 20px;
    }

    .nav-card {
      width: 80%;
      max-width: 280px;
    }
  }

  .header-section {
    .system-title .title-text {
      font-size: 20px;
      padding: 10px 20px;
    }
  }
}
</style>